<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="/lib/vue.js"></script>

</head>

<body>
  <div id="box">
    <h1 v-html="ms">as</h1>

    <h1 v-html="age"></h1>
    <!-- 相当于v-on:click=“” -->
    <button @click="yis">点我每次增加一岁</button>
    <h1 v-html="age"></h1>

    <button @click="yici(20,'我是大美女')">点我每次增加二十岁</button>
  </div>
  <script>
    var ve = new Vue({
      el: "#box",
      data: {
        ms: '传递',
        age: 18
      },
      methods: {
        yis() {
          this.age++
          console.log(ages);
          alert(12)
        },
        yici(age, mn) {//括号里面的age可以随便写 //简写，代替了function（）{}
          // alert(12)
          // this.age++//每次点击加一岁
          this.age = this.age + age//第一个this.age是上面data里面自定义的数据，括号里面的age是追加前面传过来的数
          this.ms = mn + mn
        }
      }
    })
  </script>
</body>

</html>